package com.stylefeng.guns.modular.system.warpper;

import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper;
import com.stylefeng.guns.core.util.DateUtil;

public class IndustryRankWarpper extends BaseControllerWarpper{

	public IndustryRankWarpper(List<Map<String, Object>> list) {
        super(list);
    }

	@Override
	protected void warpTheMap(Map<String, Object> map) {
		DecimalFormat df = new DecimalFormat("0.00");
    	double gZllr = ((Double)map.get("gZllr")) / 10000;
    	map.put("gZllr", gZllr > 0 ? "<font color='red'><b>"+df.format(gZllr)+"</b></font>" : "<font color='green'><b>"+df.format(gZllr)+"</b></font>");
    	double gZdf = ((Double)map.get("gZdf"));
    	map.put("gZdf", gZdf > 0 ? "<font color='red'><b>"+gZdf+"</b></font>" : "<font color='green'><b>"+gZdf+"</b></font>");
    	double gCdlr = ((Double)map.get("gCdlr")) / 10000;
    	map.put("gCdlr", gCdlr > 0 ? "<font color='red'><b>"+df.format(gCdlr)+"</b></font>" : "<font color='green'><b>"+df.format(gCdlr)+"</b></font>");
    	double gDdlr = ((Double)map.get("gDdlr")) / 10000;
    	map.put("gDdlr", gDdlr > 0 ? "<font color='red'><b>"+df.format(gDdlr)+"</b></font>" : "<font color='green'><b>"+df.format(gDdlr)+"</b></font>");
    	double gXdlr = ((Double)map.get("gXdlr")) / 10000;
    	map.put("gXdlr", gXdlr > 0 ? "<font color='red'><b>"+df.format(gXdlr)+"</b></font>" : "<font color='green'><b>"+df.format(gXdlr)+"</b></font>");
    	double gZdlr = ((Double)map.get("gZdlr")) / 10000;
    	map.put("gZdlr", gXdlr > 0 ? "<font color='red'><b>"+df.format(gZdlr)+"</b></font>" : "<font color='green'><b>"+df.format(gZdlr)+"</b></font>");
    	
    	Date gTime = ((Date)map.get("gTime"));
    	map.put("gTime", DateUtil.format(gTime, "yyyy-MM-dd"));
	}
}
